import request from '@/utils/request'

/**
 * @description 获取文章分类
 * @return { Promise }
 */
export function getArticleCate() {
    return request.get({ url: '/article/cate' })
}

/**
 * @description 获取文章列表
 * @return { Promise }
 */
export function getArticleList(data: Record<string, any>) {
    return request.get({ url: '/article/lists', data: data })
}


/**
 * @description 获取供应列表
 * @return { Promise }
 */
export function getsuList(data: Record<string, any>) {
    return request.get({ url: '/Supply/lists', data: data })
}


/**
 * @description 获取我的供应列表
 * @return { Promise }
 */
export function getgongyingList(data: Record<string, any>) {
    return request.get({ url: '/User/gongyin', data: data })
}

/**
 * @description 获取我的采购列表
 * @return { Promise }
 */
export function getcaigouList(data: Record<string, any>) {
    return request.get({ url: '/User/caigou', data: data })
}

/**
 * @description 获取文章列表
 * @return { Promise }
 */
export function getcaiList(data: Record<string, any>) {
    return request.get({ url: '/Procure/lists', data: data })
}


/**
 * @description 获取文章详情
 * @param { number } id
 * @return { Promise }
 */
export function getArticleDetail(data: { id: number }) {
    return request.get({ url: '/article/detail', data: data })
}

/**
 * @description 获取采购详情
 * @param { number } id
 * @return { Promise }
 */
export function getcaigDetail(data: { id: number }) {
    return request.get({ url: '/Procure/detail', data: data })
}

/**
 * @description 获取供应详情
 * @param { number } id
 * @return { Promise }
 */
export function getgongDetail(data: { id: number }) {
    return request.get({ url: '/supply/detail', data: data })
}


/**
 * @description 获取供应详情
 * @param { number } id
 * @return { Promise }
 */
export function getgongDetails(data: { id: number }) {
    return request.get({ url: '/supply/details', data: data })
}


/**
 * @description 删除供应信息
 * @param { number } id
 * @return { Promise }
 */
export function getgongdel(data: { id: number }) {
    return request.post({ url: '/supply/del', data: data })
}


/**
 * @description 删除采购信息
 * @param { number } id
 * @return { Promise }
 */
export function getcaidel(data: { id: number }) {
    return request.post({ url: '/Procure/del', data: data })
}


/**
 * @description 获取企业
 * @param { number } id
 * @return { Promise }
 */
export function getqiyeDetail(data:any) {
    return request.get({ url: '/user/qiye',data:data})
}



/**
 * @description 查看联系次数减一
 * @param { number } id
 * @return { Promise }
 */
export function getlianxiDetail(data:any) {
    return request.get({ url: '/user/vipjian',data:data})
}



/**
 * @description 获取企业供应
 * @param { number } id
 * @return { Promise }
 */
export function getqiyegongDetail(data:any) {
    return request.get({ url: '/user/qiyegongying',data:data})
}


/**
 * @description 获取企业采购
 * @param { number } id
 * @return { Promise }
 */
export function getqiyecaiDetail(data:any) {
    return request.get({ url: '/user/qiyecaigou',data:data})
}


/**
 * @description 加入收藏
 * @param { number } id
 * @return { Promise }
 */
export function addCollect(data: { id: number }) {
    return request.post({ url: '/article/addCollect', data: data }, { isAuth: true })
}

/**
 * @description 取消收藏
 * @param { number } id
 * @return { Promise }
 */
export function cancelCollect(data: { id: number }) {
    return request.post({ url: '/article/cancelCollect', data: data }, { isAuth: true })
}

/**
 * @description 获取收藏列表
 * @return { Promise }
 */
export function getCollect() {
    return request.get({ url: '/article/collect' })
}



/**
 * @description 获取收藏列表
 * @return { Promise }
 */
export function postFAbu(data:any) {
    return request.post({ url: '/article/supplyadd',data: data  }, { isAuth: true })
}



/**
 * @description 获取修改供应详情
 * @return { Promise }
 */
export function postxiusupply(data:any) {
    return request.post({ url: '/Supply/edit',data: data  }, { isAuth: true })
}



/**
 * @description 获取收藏列表
 * @return { Promise }
 */
export function postcai(data:any) {
    return request.post({ url: '/Procure/add',data: data  }, { isAuth: true })
}


/**
 * @description 获取修改采购详情
 * @return { Promise }
 */
export function postxiusprocure(data:any) {
    return request.post({ url: '/Procure/edit',data: data  }, { isAuth: true })
}


/**
 * @description 获取订阅列表
 * @return { Promise }
 */
export function getdingyue(data:any) {
    return request.get({ url: '/xiaoxi/lists',data:data })
}


/**
 * @description 获取订阅列表
 * @return { Promise }
 */
export function getding(data:any) {
    return request.post({ url: '/xiaoxi/dingyue',data:data})
}